<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta content="0" http-equiv="expires">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <title>hello, world!</title>
    <style>
        * {
            font-size: 24px;
            margin: 0.5em;
        }
    </style>
</head>
<body style="margin-left: 50px;">
<h1 id="currentUsername"></h1>
<p>当前页面的url：<span id="current_url"></span></p><br/><br/>
<input type="button" onclick="listAllPerson();" value="listAllPerson，拦截"/><br/>
<input type="button" onclick="Get1();" value="/pub/Get1，不拦截"/><br/>
<input type="button" onclick="Get2();" value="/pub/Get2，不拦截"/><br/>
<input type="button" onclick="testAOP4Man();" value="/pub/testAOP4Man，不拦截，男生洗澡"/><br/>
<input type="button" onclick="testAOP4Woman();" value="/pub/testAOP4Woman，不拦截，女生洗澡"/><br/>
<hr/>
<div>
    <form id="login-form" onsubmit="return false;">
        用户名：<input type="text" id="username" name="username" value="admin"/><br/>
        密码：<input type="text" id="password" name="password" value="123456"/><br/>
        <input type="button" value="提交" onclick="loginPerson();"/>
        <input type="button" value="当前登录用户" onclick="getCurrentPerson();"/>
    </form>
</div>


</body>
</html>
<!--注意引用的路径，尽量采用相对路径-->
<script src="../js/jquery.3.2.1.min.js"></script>
<script src="../js/utils.js"></script>
<script>
    function listAllPerson() {
        $.ajax({
            type: 'get',
            url: '/hello/listAllPerson?p1=val1&p2=val2',
            success: function (data) {
                alert(JSON.stringify(data));
            },
            error: function (xhr, textStatus, errorThrown) {
            }
        });
    }
    function Get1() {
        $.ajax({
            type: 'get',
            url: '/hello/pub/Get1?id=001',
            success: function (data) {
                alert(JSON.stringify(data));
            },
            error: function (xhr, textStatus, errorThrown) {
            }
        });
    }
    function Get2() {
        $.ajax({
            type: 'get',
            url: '/hello/pub/Get2',
            success: function (data) {
                alert(JSON.stringify(data));
            },
            error: function (xhr, textStatus, errorThrown) {
            }
        });
    }
    function testAOP4Man() {
        $.ajax({
            type: 'get',
            url: '/hello/pub/testAOP4Man',
            success: function (data) {
                alert(JSON.stringify(data));
            },
            error: function (xhr, textStatus, errorThrown) {
            }
        });
    }
    function testAOP4Woman() {
        $.ajax({
            type: 'get',
            url: '/hello/pub/testAOP4Woman',
            success: function (data) {
                alert(JSON.stringify(data));
            },
            error: function (xhr, textStatus, errorThrown) {
            }
        });
    }
</script>